<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta
      name="viewport"
      content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
    />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
    <div class="sticky">
      <h1>Less bezel, more screen.</h1>
    </div>
    <style>
      body {
        background-color: #000;
        margin: 0;
        height: 300vh;
      }

      .sticky {
        position: sticky;
        top: 0;
        height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
      } 

      h1 {
        font-family: Helvetica;
        margin: 0;
        padding: 0;
        font-size: 48px;
        color: #fff;
        letter-spacing: -0.3px;

        background-image: linear-gradient(
          75deg,
          rgba(255, 255, 255, 1) 0%,
          rgba(255, 255, 255, 1) 33.33%,
          rgba(255, 255, 255, 0) 66.67%,
          rgba(255, 255, 255, 0) 100%
        );
        background-size: 300% 100%;
        background-position-x: 100%;

        background-clip: text;
        -webkit-background-clip: text;
        color: transparent;

        /* 使用 CSS 滚动动画 */
        animation: scroll-reveal linear;
        animation-timeline: scroll(root);
        animation-range: 0% 100%;
      }

      @keyframes scroll-reveal {
        0% {
          background-position-x: 100%;
        }
        100% {
          background-position-x: 0%;
        }
      }

      /* 兼容性：如果浏览器不支持 animation-timeline，使用传统方式 */
      @supports not (animation-timeline: scroll()) {
        h1 {
          animation: none;
          background-position-x: 100%;
        }
      }
    </style>
  </body>
</html>
